<template>
<div>
  <van-nav-bar
      title=""
      left-arrow
      @click-left="onClickLeft"
  />
  <div class="seusstop">
    <div style="margin-bottom:10px"><van-icon color="red" name="passed" /> 支付成功！</div>
    <div><router-link tag="button" to="/" >返回首页</router-link>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<router-link tag="button" to="/orderList">查看订单</router-link></div>
  </div>
  <van-list class="addcar">
    <van-card v-for="(item,index) in list" :key="item.goods_id"
              @click="setShopId(item.goods_id)"
              :num="item.goods_number"
              :price="item.goods_price"
              desc="软件测试数据！"
              :title="item.goods_name"
              :thumb="item.goods_big_logo==''?'http://image2.suning.cn/uimg/b2c/newcatentries/0070078057-000000000634917020_1_800x800.jpg':item.goods_big_logo"
    />
  </van-list>
</div>
</template>

<script>
import request from "../api/request";

export default {
  name: "successful",
  data(){
    return{
      list:[],
    }
  },
  created() {
    this.getdata()
    },
  methods:{
    //推荐商品列表
    getdata(){
      request.get('/goods/search').then(res=>{
        let {goods}=res.data.message
        for(var i=0;i<10;i++){
          this.list.push(goods[i])
        }
      })
    },
    onClickLeft(){
      this.$router.back()
    }
  }
}
</script>

<style scoped lang="less">
.seusstop{text-align: center;padding:10px 0;margin: 10px 0}
.seusstop button{border-radius:30px;padding:2px 10px;}
</style>